FWIW-what has helped me to prevent diarrhea to some extent and assuming that the diarrhea wasn't caused by contaminated
food, is to keep logs every time I experience it to the exact foods I ate and what I had to drink for not only that meal but the one previous
to that.
For me anyways I have discovered that certain foods eaten prior to the meal at hand and what I had to drink, can and will have an
impact on me later on if choose a certain combination of food and drink.
To be clear, if I have a certain combination of food and drink at dinner and get resultant diarrhea and look at what
I had for lunch, I can honestly say based on experience that if I had had something other than what I had for lunch,
I would not have experienced diarrhea.
Sorry if this is confusing, but the bottom line is to consider ALL possible reasons/causes why you experienced diarrhea
and don't simply limit yourself to the immediate meal at hand.
All that said, I hope you feel better soon!!